package tk.mybatis.simple.service;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;

@Aspect
public class LogHandle {
    @Pointcut("execution(* tk.mybatis.simple.service.*.use(..))")
    public void myMethod(){};
    
    @Before("myMethod()")
    public void LogBefore(JoinPoint joinPoint) {
		System.out.println("Log before method");
		try {
			((ProceedingJoinPoint)joinPoint).proceed();
		} catch (Throwable e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}
	}
    @After("myMethod()")
	public void LogAfter(JoinPoint joinPoint) {
		System.out.println("Log after method");
	}
}
